#ifndef __property_h__
#define __property_h__ 1

#include "opt.h"
#include "acn_arch.h"
#include "acnstdtypes.h"
#include "component.h"
#include "acn_dmp.h"
#include "dmp.h"

#ifdef __cplusplus
 "C" {
#endif



typedef struct dmp_property_s {
	uint32_t        address;
	uint32_t        ref_count;
} dmp_property_t;

/* struct for property and address map*/
typedef struct dmp_property_map_s {
	dmp_property_t      	property;
	uint16_t				 size;
	uint8_t        	  		 *value;
	struct dmp_property_map_s   *next;
} dmp_property_map_t;

typedef void property_callback(
	dmp_property_map_t property
);

/*functions*/

dmp_property_map_t *property_new(uint32_t address,uint16_t size);
dmp_property_map_t *property_findby_address(uint32_t address);
int property_deleteby_address(uint32_t address);
uint8_t *encode_property(dmp_property_map_t *property,uint8_t *datap);
int decode_property(uint32_t address,uint8_t *proterty_ptr,dmp_property_map_t **property);
int set_property(uint32_t address,uint8_t *datap);
/* not recommended */
uint16_t get_property_ptr(uint32_t address,uint8_t **ptr);
void property_close();
void property_release(dmp_property_map_t *property);
//display
void display_property(dmp_property_map_t *property);
void display_all();

#ifdef __cplusplus
 }
#endif

#endif //__property_h__
